package com.hn658.message.config.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.baidu.disconf.client.common.annotations.DisconfFile;
import com.baidu.disconf.client.common.annotations.DisconfFileItem;
import com.baidu.disconf.client.common.annotations.DisconfUpdateService;
import com.baidu.disconf.client.common.update.IDisconfUpdate;
import com.hn658.message.config.service.IBaseMessageConfig;

/**
 * 
 * 统一用户系统配置文件
 * @author ztjie
 * @date 2015-10-22 下午1:39:24
 * @since
 * @version
 */
@DisconfFile(filename = "basemessage.properties")
@DisconfUpdateService(classes = {DisconfBaseMessageConfig.class})
public class DisconfBaseMessageConfig implements IDisconfUpdate, IBaseMessageConfig {

    protected static final Logger LOGGER = LoggerFactory.getLogger(DisconfBaseMessageConfig.class);

	// 消息服务平台的应用ID
    private String appId;
    
    // 统一登录URL
    private String loginUrl;
    
    /**
     * 文件保存路径
     */
    private String fileRoot = "/srv/base/message";

    /**
     * 获取消息服务平台的应用ID
     *
     * @return
     */
    @Override
    @DisconfFileItem(name = "base.message.appId", associateField = "appId")
	public String getAppId() {
		return appId;
	}
    
    @Override
    @DisconfFileItem(name = "base.message.loginUrl", associateField = "loginUrl")
	public String getLoginUrl() {
		return loginUrl;
	}

	public void setLoginUrl(String loginUrl) {
		this.loginUrl = loginUrl;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	@Override
	public void reload() throws Exception {
		// TODO Auto-generated method stub
		
	}
	@Override
	@DisconfFileItem(name = "upload.file.root", associateField = "fileRoot")	
	public String getFileRoot() {
		return fileRoot;
	}

	public void setFileRoot(String fileRoot) {
		this.fileRoot = fileRoot;
	}
	
		
}
